<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: edit_option.php 11 2013-09-21 11:43:11Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 11 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 11:43:11 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

echo draw_form('new_option', FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_option_name&'.getMenuID('products_attributes').$opt_add, 'post', 'id="dialog_form" enctype="multipart/form-data"'); 
echo draw_hidden_field('option_id', (int)$_GET['option_id']);
?>
	<table width="100%" cellpadding="6">
		<?php
			$inputs = '';
			for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {
				$option_name = $db->db_query("SELECT
												products_options_name,
												products_options_desc,
												products_options_image
											FROM
												".TABLE_PRODUCTS_OPTIONS."
											WHERE
												products_options_id = '".(int)$_GET['option_id']."'
											AND
												language_id = '".$languages[$i]['id']."'");

				echo '<tr><td valing="top"><b>Name:</b></td><td>';
				echo image('../lang/'.$languages[$i]['directory'].'/'.$languages[$i]['image'], $languages[$i]['name']).' <input type="text" name="option_name['.$languages[$i]['id'].']" size="20" value="'.$option_name->fields['products_options_name'].'" /></td></tr>';

				echo '<tr><td valing="top"><b>Grafik:</b></td><td>';
				echo image('../lang/'.$languages[$i]['directory'].'/'.$languages[$i]['image'], $languages[$i]['name']).' '. draw_file_field('option_image_'. $languages[$i]['id']). '<br />';
				if(!empty($option_name->fields['products_options_image'])) {
					echo '<img class="opt_val_img" src="../images/product_options/'.$option_name->fields['products_options_image'].'" alt="" /> ';
					echo $option_name->fields['products_options_image'].'<br /> L&ouml;schen? <input type="checkbox" name="del_option_image_'. $languages[$i]['id'].'" value="yes" />';
				}
				echo draw_hidden_field('previous_opt_image['.$languages[$i]['id'].']', $option_name->fields['products_options_image'])."\n";
				echo '</td></tr>';

				echo '<tr><td valing="top"><b>Beschreibung:</b></td><td>';
				echo image('../lang/'.$languages[$i]['directory'].'/'.$languages[$i]['image'], $languages[$i]['name']).' <textarea name="option_desc['.$languages[$i]['id'].']" cols="50" rows="4" style="width:95%">'.$option_name->fields['products_options_desc'].'</textarea></td></tr>';
			}
		?>
	</table>
</form>